
<?php
//var_dump($_POST, $_GET);
session_start();
$nomeEmpresa =mysql_real_escape_string($_GET['setor']);
//$nomeSetor = $_SESSION['setor'];
//$nomeEmpresa = 'Teste2';
include 'classes/Crud.php';
$con = new Crud();
$con->connect();
$sql= mysql_query("select setorfk from categorias where nome='$nomeEmpresa' and heranca=0");
$res = mysql_fetch_array($sql);
$idSetor=$res['setorfk'];
$ssql = mysql_query("SELECT nome from categorias WHERE LOCATE(setorfk, $idSetor)>0 AND heranca > 0");
//echo "<select>";
//echo "<option>Escolha Pasta</option>";
while($ss = mysql_fetch_array($ssql)){
$nme = $ss['nome'];
echo "<option>$nme</option>";
   }
//  echo "</select>";
?>
